package com.kangyi.admin.mapper;

import com.github.pagehelper.Page;
import com.kangyi.admin.annotation.AutoFill;
import com.kangyi.dto.EntryManagementPageQueryDTO;
import com.kangyi.entity.NursingHomeApplication;
import com.kangyi.enumeration.OperationType;
import com.kangyi.vo.NursingHomeApplicationDetailVO;
import com.kangyi.vo.NursingHomeApplicationPageQueryVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author Blank
 * @version 1.0
 */
@Mapper
public interface EntryManagementMapper {
    Page<NursingHomeApplicationPageQueryVO> pageQuery(EntryManagementPageQueryDTO entryManagementPageQueryDTO);

    void deleteRegistrationApplication(List<Integer> ids);

    NursingHomeApplicationDetailVO detailApplication(Integer id);


    @AutoFill(value = OperationType.UPDATE)
    void refuseApplication(NursingHomeApplication build);

    @Select("select * from nursing_home_application where id = #{id}")
    NursingHomeApplication getById(Integer id);



    @Update("update nursing_home_application set status = #{status}, update_time = #{updateTime}, update_user = #{updateUser} where id = #{id}")
    @AutoFill(value = OperationType.UPDATE)
    void passApplication(NursingHomeApplication nursingHomeApplication);


}
